<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link th:href="@{/ajax/libs/datapicker/datepicker3.css}" rel="stylesheet"/>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-contract-add">
        <div class="form-group">
            <label class="col-sm-3 control-label">合同名称：</label>
            <div class="col-sm-8">
                <input id="name" name="name" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">合同号：</label>
            <div class="col-sm-8">
                <input id="contractNumber" name="contractNumber" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">委托单位：</label>
            <div class="col-sm-8">
                <input id="entrusting" name="entrusting" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">委托账号：</label>
            <div class="col-sm-8">
                <input id="entrustingAccount" name="entrustingAccount" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">收款账户：</label>
            <div class="col-sm-8">
                <input id="collection" name="collection" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">预警选择：</label>
            <div class="col-sm-8">
                <div class="input-group date"><span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input type="text" class="form-control" id="endTime" name="endTime">
                </div>
            </div>

        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">结算方式：</label>
            <div class="col-sm-8">
                <input id="payType" name="payType" class="form-control" type="text">
            </div>
        </div>
    </form>
</div>
<div th:include="include::footer"></div>
<script th:src="@{/ajax/libs//datapicker/bootstrap-datepicker.js}"></script>
<script type="text/javascript">
    var prefix = ctx + "system/contract"
    $("#form-contract-add").validate({
        rules: {
            payType: {
                required: true,
            },
            endTime: {
                required: true,
            },
            collection: {
                required: true,
            },
            entrustingAccount: {
                required: true,
            },
            entrusting: {
                required: true,
            },
            name: {
                required: true,
            },
            contractNumber: {
                required: true,
            },
        }
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-contract-add').serialize());
        }
    }

    $(".input-group.date").datepicker({
        todayBtn: "linked",
        keyboardNavigation: !1,
        forceParse: !1,
        calendarWeeks: !0,
        autoclose: !0
    });
</script>
</body>
</html>
